package com.bjpowernode.springboot.service.impl;

import com.bjpowernode.springboot.dao.UserDao;
import com.bjpowernode.springboot.domain.User;
import com.bjpowernode.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * CreateTime：2020/9/1 17:26
 */

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    @Transactional
    public List<User> getUserList() {

        User user = new User();
        user.setId("12345678");
        user.setName("王二麻子");

        userDao.update(user);

        List<User> uList = userDao.getUserList();

        System.out.println(2/0);
        return uList;
    }
}
